package com.grape.config;

import com.grape.property.MinioProperty;
import io.minio.MinioClient;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 类描述： Minio配置类
 *
 * @author  putao
 * @email   2628279194@qq.com
 */
@RequiredArgsConstructor
@Configuration
public class MinioConfig {

	private final MinioProperty minioProperty;

    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder().endpoint(minioProperty.getUrl())
				.credentials(minioProperty.getAccessKey(), minioProperty.getSecretKey()).build();
    }

}
